package com.heima.task.job;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class HelloJob {


    /**
     * 每2秒执行一次代码
     */
    @Scheduled(cron = "1,5,10 5/20 * * * ?")
    public void printDate(){
        System.out.println(new Date());
    }
}
